#!/usr/bin/env python
# chmod a+x flow.cfg
PACKAGE = "thermalvis"
import roslib; roslib.load_manifest("dynamic_reconfigure")
import roslib;roslib.load_manifest(PACKAGE)

# echo $PACKAGE

from dynamic_reconfigure.parameter_generator import *

gen = ParameterGenerator()


gen.add("maxFeatures", int_t, 0, "Maximum number of features to attempt tracking", 300, 0, 1000)
gen.add("minFeatures", int_t, 0, "Minimum number of features to be tracked before triggering redetection", 30, 0, 1000)

matching_enum = gen.enum([ 
	gen.const("NN", int_t, 0, "Nearest Neighbour"),
	gen.const("NNDR", int_t, 1, "Nearest Neighbour Distance Ratio"),
	gen.const("LDA", int_t, 2, "Learned LDA-SVM Reweighting") ],
	"An enum to set the matching approach for interruption handling")
	
gen.add("flowThreshold", double_t, 0, "Sensitivity for optical flow algorithm", 0.002, 0.0000, 1.0000)
gen.add("attemptMatching", bool_t, 0, "Also attempt to match features that weren't able to be tracked", True);
gen.add("detectEveryFrame", bool_t, 0, "Apply detection along with tracking for every frame", False);
gen.add("matchingMode", int_t, 0, "Matching Mode", 2, 0, 2, edit_method=matching_enum)

detector_enum = gen.enum([ 
	gen.const("OFF", int_t, 0, "No detector implemented"),
	gen.const("GFTT", int_t, 1, "Hessian features (GFTT)"),
	gen.const("FAST", int_t, 2, "FAST"),
	gen.const("HARRIS", int_t, 3, "Harris features (GFTT)") ],
	"An enum to set the detector type")
	
gen.add("detector_1", int_t, 0, "Detector #1", 1, 0, 3, edit_method=detector_enum)
gen.add("sensitivity_1", double_t, 0, "Detector #1 sensitivity", 0.1, 0.00, 1.00)

gen.add("detector_2", int_t, 0, "Detector #2", 0, 0, 3, edit_method=detector_enum)
gen.add("sensitivity_2", double_t, 0, "Detector #2 sensitivity", 0.1, 0.00, 1.00)

gen.add("detector_3", int_t, 0, "Detector #3", 0, 0, 3, edit_method=detector_enum)
gen.add("sensitivity_3", double_t, 0, "Detector #3 sensitivity", 0.1, 0.00, 1.00)

gen.add("adaptiveWindow", bool_t, 0, "Expand or shrink feature search window based on number of features and their speed", True)
gen.add("velocityPrediction", bool_t, 0, "Use feature velocities to inform tracking search", True)
gen.add("maxVelocity", double_t, 0, "Maximum feature velocity allowable for prediction", 200.0, 0.0, 10000.0)
gen.add("maxFrac", double_t, 0, "Maximum proportion of minor image dimension that points may drift between frames for tracking", 0.05, 0.00, 1.00)
gen.add("minSeparation", double_t, 0, "Minimum spatial separation between features", 3.0, 0.0, 50.0)

gen.add("delayTimeout", double_t, 0, "Timeout in seconds before NUC is assumed", 0.0, 0.0, 10.0)
gen.add("newFeaturesPeriod", double_t, 0, "Periodic time (s) for which to detect new features", 0.5, 0.0, 60.0)
gen.add("attemptHistoricalRecovery", bool_t, 0, "Attempt to recovery lost tracks each for each period interrupt", True)

gen.add("multiplier_1", int_t, 0, "How many cycles to wait before replacing history data #1", 3, 0, 1000)
gen.add("multiplier_2", int_t, 0, "How many cycles to wait before replacing history data #2", 10, 0, 1000)

gen.add("verboseMode", bool_t, 0, "Increase console text output", False);
gen.add("debugMode", bool_t, 0, "Publish output for display purposes", False)
gen.add("autoTrackManagement", bool_t, 0, "Store only necessary feature tracking information to limit memory usage", True)
gen.add("showTrackHistory", bool_t, 0, "Display track history", False)
gen.add("drawingHistory", int_t, 0, "Number of projections for the feature tail in the debug image", 25, 0, 100)


	


exit(gen.generate(PACKAGE, "flow", "flow"))
